<?php

namespace app\index\validate;

use think\Validate;
class Message extends Validate
{
    /**
     * 验证规则
     */

    protected $rule = [
        "name" =>"require",
        'phone' => 'require|max:11|/^1[3-8]{1}[0-9]{9}$/',
        "message"    =>"require"
    ];

    /**
     * 提示消息
     */
    protected $message = [
        "name.require"=>"请填写您的姓名",
        'phone.require' => '请输入手机号码',
        'phone.max' => '手机号码不能超过11位！',
        'phone./^1[3-8]{1}[0-9]{9}$/' => '手机号码格式不正确',
        "message.require"   =>"留言为必填项"
    ];
}